<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.weavernorth.humanresource.AutoLogin" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="weaver.integration.util.SessionUtil" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.general.Util" %>
<%
    BaseBean bb = new BaseBean();
    bb.writeLog("人事自助跳转页面");
    User user_new = null;
    AutoLogin autoLogin = new AutoLogin();

    String strPhone = Util.null2String(request.getParameter("phone"));
    bb.writeLog("测试电话号码:"+strPhone);
    String strUid = autoLogin.createUserSessionAndGetDispatcherUrl(strPhone);
    //OA有相关人员
    User user = (User) request.getSession(true).getAttribute("weaver_user@bean");
    if (user == null) {
        bb.writeLog("用户session还未构造，新登录");
    } else if ((user != null && !user.getLoginid().equals("rzry"))) {
        bb.writeLog("老用户session=" + user.getLoginid() + " 新用户session=" + "rzry");
    }
    if (user == null || (user != null && !user.getLoginid().equals("rzry"))) {
        // 人员还未登录，构造人员
        SessionUtil.createSession(strUid, request, response);
    } else {
        // 人员已登录
        user_new = user;
    }
    //session构建后查询当前人员的requestid
    String strRequestid = autoLogin.getRequestid(strUid);
    bb.writeLog("当前入职人员的流程id"+strRequestid);
    String strRequestUrl="/spa/workflow/static4form/index.html?_rdm=1575251636288#/main/workflow/req?requestid="+strRequestid;
    bb.writeLog("当前请求流程路径"+strRequestUrl);
     response.sendRedirect(strRequestUrl);

%>